package P1000;

import java.util.Scanner;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-10-12 12:00
 */
public class P1022_计算器的改良 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        scanner.close();
        String[] splits = input.split("=");
        int x = 0,y = 0;
        int[] res = help(splits[0]);
        x += res[0];
        y += res[1];
        char c = res[2] == -1 ? ' ':(char)('a'+res[2]);
        res = help(splits[1]);
        x -= res[0];
        y -= res[1];
        c = res[2] == -1 ? c:(char)('a'+res[2]);
        double d = (double)x/(double)-y;
        System.out.printf("%c=%.3f\n",c,d);

    }

    private static int[] help(String str) {
        int[] res = new int[3];
        res[2] = -1;
        str = "+" + str;//适配规则
        char[] chars = str.toCharArray();
        int index = 0;
        while (index < chars.length) {
            boolean zf = chars[index++] == '+';//加减运算符
            boolean flag = chars[index] != '-';//后面是不是-号
            int run = index;
            if(zf){
                zf = flag;
            }else{
                zf = !flag;
            }
            if (!flag) run++;
            StringBuilder sb = new StringBuilder();
            while (run < str.length() && chars[run] != '-' && chars[run] != '+') {
                sb.append(chars[run++]);
            }
            String now = sb.toString();
            char last = now.charAt(now.length() - 1);
            if (last >= '0' && last <= '9') {
                int val = Integer.valueOf(now);
                if(!zf) val *= -1;
                res[0] += val;
            } else {
                res[2] = last-'a';
                now = now.substring(0, now.length() - 1);
                int val = 0;
                if(now.length() == 0) val = 1;
                else val = Integer.valueOf(now);
                if(!zf) val *= -1;
                res[1] += val;
            }
            index = run;
        }
        return res;
    }
}
